//
//  NewsImageScrollView.m
//  CarWorld
//
//  Created by 曹杨杨 on 15/3/28.
//  Copyright (c) 2015年 CarWorldTeam. All rights reserved.
//

#import "NewsImageScrollView.h"
#import "c_NewsListData.h"
@implementation NewsImageScrollView
- (void)dealloc
{
    [_NewsListData release];
    [_btn1 release];
    [_btn2 release];
    [_btn3 release];
    [_btn4 release];
    [_AAA release];
    [_BBB release];
    [_CCC release];
    [_DDD release];
    [_label1 release];
    [_label2 release];
    [_label3 release];
    [_label4 release];
    [super dealloc];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        CGRect rect = [UIScreen mainScreen].bounds;
        CGFloat width = rect.size.width;
        CGFloat height = width/2;
        _AAA = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
        _AAA.userInteractionEnabled = YES;
        [self addSubview:_AAA];
        _btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn1.frame = CGRectMake(0, 0, width, height);
        [_AAA addSubview:_btn1];
        
        _BBB = [[UIImageView alloc] initWithFrame:CGRectMake(width, 0, width, height)];
        _BBB.userInteractionEnabled = YES;
        [self addSubview:_BBB];
        _btn2 = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn2.frame = CGRectMake(width, 0, width, height);
        [self addSubview:_btn2];
        
        _CCC = [[UIImageView alloc] initWithFrame:CGRectMake(width*2, 0, width, height)];
        _CCC.userInteractionEnabled = YES;
        [self addSubview:_CCC];
        _btn3 = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn3.frame = CGRectMake(width*2, 0, width, height);
        [self addSubview:_btn2];
        [self addSubview:_btn3];
        
        _DDD = [[UIImageView alloc] initWithFrame:CGRectMake(width*3, 0, width, height)];
        _DDD.userInteractionEnabled = YES;
        [self addSubview:_DDD];
        _btn4 = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn4.frame = CGRectMake(width*3, 0, width, height);
        [self addSubview:_btn2];
        [self addSubview:_btn4];
        
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        _label1 = [[UILabel alloc] initWithFrame:CGRectMake(0, height * 0.81, width, height * 0.19)];
        _label1.textColor = [UIColor whiteColor];
        _label1.backgroundColor = [UIColor colorWithRed:7/255.0 green:8/255.0 blue:2/255.0 alpha:0.3];
        _label1.font = [UIFont systemFontOfSize:14 weight:2];
        [self addSubview:_label1];
        _label2 = [[UILabel alloc] initWithFrame:CGRectMake(width, height * 0.81, width, height * 0.19)];
        _label2.textColor = [UIColor whiteColor];
        _label2.backgroundColor = [UIColor colorWithRed:7/255.0 green:8/255.0 blue:2/255.0 alpha:0.3];
        _label2.font = [UIFont systemFontOfSize:14 weight:2];
        [self addSubview:_label2];
        _label3 = [[UILabel alloc] initWithFrame:CGRectMake(width*2, height * 0.81, width, height * 0.19)];
        _label3.textColor = [UIColor whiteColor];
        _label3.backgroundColor = [UIColor colorWithRed:7/255.0 green:8/255.0 blue:2/255.0 alpha:0.3];
        _label3.font = [UIFont systemFontOfSize:14 weight:2];
        [self addSubview:_label3];
        _label4 = [[UILabel alloc] initWithFrame:CGRectMake(width*3, height * 0.81, width, height * 0.19)];
        _label4.textColor = [UIColor whiteColor];
        _label4.backgroundColor = [UIColor colorWithRed:7/255.0 green:8/255.0 blue:2/255.0 alpha:0.3];
        _label4.font = [UIFont systemFontOfSize:14 weight:2];
        [self addSubview:_label4];
        
        
        
        
        
        
    }
    return self;
}

//- (void)setNewsListData:(c_NewsListData *)newsListData
//{
//    if (_NewsListData !=newsListData) {
//        [_NewsListData release];
//        _NewsListData = [newsListData retain];
//        _AAA.image = newsListData.image;
//        
//        
//    }
//}

@end
